.class public Lcom/flyfish/moregames/MoreGamesActivity;
.super Landroid/app/ListActivity;
.source "MoreGamesActivity.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/flyfish/moregames/MoreGamesActivity$MyAdapter;
    }
.end annotation


# instance fields
.field private context:Landroid/content/Context;

.field private final game_icon:Ljava/lang/String;

.field private final game_info:Ljava/lang/String;

.field private final game_name:Ljava/lang/String;

.field private game_packages:[Ljava/lang/String;


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 27
    invoke-direct {p0}, Landroid/app/ListActivity;-><init>()V

    .line 31
    const-string v0, "game_icon"

    iput-object v0, p0, Lcom/flyfish/moregames/MoreGamesActivity;->game_icon:Ljava/lang/String;

    .line 32
    const-string v0, "game_name"

    iput-object v0, p0, Lcom/flyfish/moregames/MoreGamesActivity;->game_name:Ljava/lang/String;

    .line 33
    const-string v0, "game_info"

    iput-object v0, p0, Lcom/flyfish/moregames/MoreGamesActivity;->game_info:Ljava/lang/String;

    .line 27
    return-void
.end method

.method static synthetic access$0(Lcom/flyfish/moregames/MoreGamesActivity;)Landroid/content/Context;
    .locals 1
    .parameter

    .prologue
    .line 30
    iget-object v0, p0, Lcom/flyfish/moregames/MoreGamesActivity;->context:Landroid/content/Context;

    return-object v0
.end method

.method private showGameInfo(Ljava/lang/String;)V
    .locals 4
    .parameter "packageName"

    .prologue
    .line 81
    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "market://details?id="

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v1

    .line 82
    .local v1, uri:Landroid/net/Uri;
    new-instance v0, Landroid/content/Intent;

    const-string v2, "android.intent.action.VIEW"

    invoke-direct {v0, v2, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V

    .line 83
    .local v0, intent:Landroid/content/Intent;
    invoke-virtual {p0, v0}, Lcom/flyfish/moregames/MoreGamesActivity;->startActivity(Landroid/content/Intent;)V

    .line 84
    return-void
.end method


# virtual methods
.method public onCreate(Landroid/os/Bundle;)V
    .locals 12
    .parameter "savedInstanceState"

    .prologue
    const/16 v11, 0x400

    const/16 v10, 0x80

    .line 38
    invoke-super {p0, p1}, Landroid/app/ListActivity;->onCreate(Landroid/os/Bundle;)V

    .line 39
    invoke-virtual {p0}, Lcom/flyfish/moregames/MoreGamesActivity;->getIntent()Landroid/content/Intent;

    move-result-object v4

    .line 40
    .local v4, intent:Landroid/content/Intent;
    const-string v9, "game_icon"

    invoke-virtual {v4, v9}, Landroid/content/Intent;->getIntArrayExtra(Ljava/lang/String;)[I

    move-result-object v0

    .line 41
    .local v0, game_icons:[I
    const-string v9, "game_name"

    invoke-virtual {v4, v9}, Landroid/content/Intent;->getStringArrayExtra(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v2

    .line 42
    .local v2, game_names:[Ljava/lang/String;
    const-string v9, "game_info"

    invoke-virtual {v4, v9}, Landroid/content/Intent;->getStringArrayExtra(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v1

    .line 43
    .local v1, game_infos:[Ljava/lang/String;
    const-string v9, "game_package"

    invoke-virtual {v4, v9}, Landroid/content/Intent;->getStringArrayExtra(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v9

    iput-object v9, p0, Lcom/flyfish/moregames/MoreGamesActivity;->game_packages:[Ljava/lang/String;

    .line 46
    invoke-virtual {p0}, Lcom/flyfish/moregames/MoreGamesActivity;->getWindow()Landroid/view/Window;

    move-result-object v9

    invoke-virtual {v9, v10, v10}, Landroid/view/Window;->setFlags(II)V

    .line 47
    invoke-virtual {p0}, Lcom/flyfish/moregames/MoreGamesActivity;->getWindow()Landroid/view/Window;

    move-result-object v9

    invoke-virtual {v9, v11, v11}, Landroid/view/Window;->setFlags(II)V

    .line 48
    iput-object p0, p0, Lcom/flyfish/moregames/MoreGamesActivity;->context:Landroid/content/Context;

    .line 49
    new-instance v7, Ljava/util/ArrayList;

    invoke-direct {v7}, Ljava/util/ArrayList;-><init>()V

    .line 50
    .local v7, mapList:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;>;"
    if-eqz v0, :cond_0

    .line 52
    array-length v5, v0

    .line 53
    .local v5, len:I
    const/4 v3, 0x0

    .local v3, i:I
    :goto_0
    if-lt v3, v5, :cond_1

    .line 66
    .end local v3           #i:I
    .end local v5           #len:I
    :cond_0
    new-instance v8, Lcom/flyfish/moregames/MoreGamesActivity$MyAdapter;

    invoke-direct {v8, p0, v7}, Lcom/flyfish/moregames/MoreGamesActivity$MyAdapter;-><init>(Lcom/flyfish/moregames/MoreGamesActivity;Ljava/util/ArrayList;)V

    .line 67
    .local v8, myAdapter:Lcom/flyfish/moregames/MoreGamesActivity$MyAdapter;
    invoke-virtual {p0, v8}, Lcom/flyfish/moregames/MoreGamesActivity;->setListAdapter(Landroid/widget/ListAdapter;)V

    .line 68
    return-void

    .line 55
    .end local v8           #myAdapter:Lcom/flyfish/moregames/MoreGamesActivity$MyAdapter;
    .restart local v3       #i:I
    .restart local v5       #len:I
    :cond_1
    new-instance v6, Ljava/util/HashMap;

    invoke-direct {v6}, Ljava/util/HashMap;-><init>()V

    .line 56
    .local v6, map:Ljava/util/HashMap;,"Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;"
    const-string v9, "game_icon"

    aget v10, v0, v3

    invoke-static {v10}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v10

    invoke-virtual {v6, v9, v10}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 57
    const-string v9, "game_name"

    aget-object v10, v2, v3

    invoke-virtual {v6, v9, v10}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 58
    const-string v9, "game_info"

    aget-object v10, v1, v3

    invoke-virtual {v6, v9, v10}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 59
    invoke-virtual {v7, v6}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 53
    add-int/lit8 v3, v3, 0x1

    goto :goto_0
.end method

.method protected onListItemClick(Landroid/widget/ListView;Landroid/view/View;IJ)V
    .locals 1
    .parameter "l"
    .parameter "v"
    .parameter "position"
    .parameter "id"

    .prologue
    .line 73
    iget-object v0, p0, Lcom/flyfish/moregames/MoreGamesActivity;->game_packages:[Ljava/lang/String;

    if-eqz v0, :cond_0

    .line 75
    iget-object v0, p0, Lcom/flyfish/moregames/MoreGamesActivity;->game_packages:[Ljava/lang/String;

    aget-object v0, v0, p3

    invoke-direct {p0, v0}, Lcom/flyfish/moregames/MoreGamesActivity;->showGameInfo(Ljava/lang/String;)V

    .line 77
    :cond_0
    return-void
.end method
